Fix code quality issues: sentence case, promise handling, deprecated functions, settings headings#9
Merged
nilsandrey merged 6 commits intomainfrom Mar 9, 2026
Conversation
Co-authored-by: nilsandrey <3579285+nilsandrey@users.noreply.github.com>
Co-authored-by: nilsandrey <3579285+nilsandrey@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issues detected in code quality
Fix code quality issues: sentence case, promise handling, deprecated functions, settings headings
Mar 9, 2026
There was a problem hiding this comment.
Pull request overview
Addresses ESLint and API deprecation findings in the Obsidian Text Tools plugin by adjusting UI text, improving promise/lint safety, modernizing Base64 encoding/decoding, and aligning settings UI structure with Obsidian’s Setting heading API.
Changes:
- Modernize Base64 encode/decode to use
TextEncoder/TextDecoderand tighten some type annotations. - Update UI strings for sentence case and refactor settings headings to use
Setting(...).setHeading(). - Improve promise-handling lint compliance (async
onSubmitsupport, explicit ignored promises) and add ESLint flat config + dependencies.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
main.ts |
Sentence-case updates, promise handling change for settings persistence, and safer typing around settings loading. |
src/modals/InputModal.ts |
Broadens onSubmit typing to allow async callbacks and marks returned promises as intentionally ignored. |
src/settings-tab.ts |
Switches settings section headings to Obsidian’s Setting(...).setHeading() pattern and tweaks descriptions. |
src/transforms/encode.ts |
Replaces deprecated escape/unescape Base64 shim with TextEncoder/TextDecoder; minor type-safety improvements. |
src/transforms/lines.test.ts |
Removes unused vi import. |
eslint.config.mjs |
Adds ESLint flat config using eslint-plugin-obsidianmd with sentence-case rule customization. |
package.json |
Adds ESLint-related dev dependencies to support the new lint configuration. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Nils <nilsandrey@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Nils <nilsandrey@gmail.com>
…ync onSubmit errors Co-authored-by: nilsandrey <3579285+nilsandrey@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
;in settings-tab.ts (replaced with heading, then removed redundant plugin-name heading)"Join every N lines"→"Join every n lines"in main.tsunknownthis.saveSettings()→void this.saveSettings().catch(...)(main.ts L799)unescape/escapein encode.ts (replaced with TextEncoder/TextDecoder)viimport in lines.test.tsno-undeffor btoa/atob in ESLint config (added browser globals)eslint-plugin-obsidian(wrong package), fix ESLint → 9.x and@eslint/json→ 0.14.0 to match plugin peer deps; regenerate package-lock.json sonpm ciworks{ fatal: true }in TextDecoder for base64Decode to preserve fallback behavior on invalid UTF-8npm cisucceedsOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.